package Anonymous01;

public abstract class Animal {
    private String name;
    private int age;

    public Animal() {
    }

    public Animal(String name, int age) {
        this.setName(name);
        this.setAge(age);
    }

    public Animal(int age, String name) {
        this.setName(name);
        this.setAge(age);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if ((age >= 0) && (age <= 15))
            this.age = age;
        else System.out.printf("Invalid age %d. The age of animal should be within 0 and 15", age);
    }

    public abstract void eat();
}
